package chapter3;
import java.util.Scanner;
/****************************************************************
 * Author：icynlau
 * Description:  当前时间  基于exc2_8
 * Date:2021/4/2
 * ***************************************************************
 */
public class exc3_30 {
	public static void main(String[] args ) {
		Scanner input=new Scanner(System.in);
		System.out.print("Enter the time zone offset to GMT:");
		int timeZone=input.nextInt();
		
		long currentHour=System.currentTimeMillis()/1000/60/60%24+timeZone;
		long currentMin=System.currentTimeMillis()/1000/60%60;
		long currentSec=System.currentTimeMillis()/1000%60;
		String tail="AM";
		if(currentHour>12) {
			currentHour-=12;
			tail="PM";
		}
		
		System.out.println("The current time is "+currentHour+":"+currentMin+":"+currentSec+"  "+tail);
		
	}

}
